package com.yds.dubbo.tracing.consumer;

import com.sun.org.slf4j.internal.Logger;
import com.sun.org.slf4j.internal.LoggerFactory;
import com.yds.dubbo.tracing.consumer.action.HelloServiceConsumer;
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * @author liuhongzhen
 * @date 2023/3/24 15:30
 */
@SpringBootApplication
@EnableDubbo
public class ConsumerBootstrap {

    private static final Logger LOGGER = LoggerFactory.getLogger(ConsumerBootstrap.class);


    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(ConsumerBootstrap.class, args);

        HelloServiceConsumer application = context.getBean(HelloServiceConsumer.class);
        for (int i = 0; i < 10; i++) {
            String result = application.doSayHello("world");
            LOGGER.debug("result: {}", result);
        }
    }


}
